// 统一管理项目中所有的请求路径 api
import request from "./request"
import qs from "qs"
// 首页精品推荐请求
// export const JingpinAPI = function(){
//   return request.get("/products/recommend")
// } 
export const JingpinAPI = () => request.get("/products/recommend");
// 首页热门兑换请求
export const RemenAPI = () => request.get("/products/hot");

// 发送短信验证码请求
export const SendSMSAPI = (params) => request.post("/sendSMS",qs.stringify(params));
// 发送登录请求
export const PhoneLoginAPI = (params) => request.post("/phoneRegin",qs.stringify(params));

// 扫码登录请求
export const WeixinLoginAPI = (params) => request.post("/wechatUsers/PCLogin",qs.stringify(params));

// 手机绑定微信请求
export const BindPhoneAPI = (params) => request.post("/wechatUsers/binding",qs.stringify(params));


// 请求登录的用户信息
export const UserProfilesAPI = () => request.get("/shop/userProfiles");


// 请求商品详情
export const GoodsDetailsAPI = (id) => request.get(`/products/${id}`);

// 请求加入购物车
export const AddToCartAPI = (params) => request.post("/shop/carts/add",qs.stringify(params));



// console.log(qs.stringify({aa:10,bb:20}));

// JSON.stringify  "{aa:10,bb:20}"
// qs.stringify  "aa=10&bb=20"

// 在组件中调用
// SendSMSAPI({
//   phone:,

// })

